	b	start
	b	.
	b	.
	b	.
	b	.
	b	.
	b	.
	b	.

hello_str:
	.string	"Hello\r\n"
p_hello_str:
	.word	hello_str

uart_print:
	ldr	r1, =0xfffe0020
	b	.test
.wait:
	ldrb	r3, [r1, #5]
	tst	r3, #32
	beq	.wait
	strb	r2, [r1]
	add	r0, #1
.test:
	ldrb	r2, [r0]
	cmp	r2, #0
	bne	.wait
	bx	lr

start:
	@ configure UART
	ldr	r1, =0xfffe0020
	mov	r2, #0x83
	strb	r2, [r1, #3]
	mov	r2, #108
	strb	r2, [r1]
	mov	r2, #0
	strb	r2, [r1, #1]
	mov	r2, #3
	strb	r2, [r1, #3]

	@ send test message
	ldr	r0, p_hello_str
	bl	uart_print

	b	.
